# Maintainer: Florian Pritz <bluewind@xinu.at>
# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=vimpager
pkgver=1.8.2
pkgrel=1
pkgdesc="A vim-based script to use as a PAGER."
arch=('any')
url="http://www.vim.org/scripts/script.php?script_id=1723"
license=('custom:vim')
depends=('vim')
noextract=(vimpager-$pkgver.tar.gz)
backup=(etc/vimpagerrc)
source=("vimpager-$pkgver.tar.gz::https://github.com/rkitover/vimpager/tarball/$pkgver" 
	license.txt)
md5sums=('78ec2fee90d0c33247ef2ee95452b4aa'
         'cd49910a3dde6fe0a7e24ebe8cbf7066')

build() {
	cd "${srcdir}"

	mkdir -p "$srcdir/vimpager-$pkgver"
	bsdtar --strip-components=1 -C "$srcdir/vimpager-$pkgver" -xf vimpager-$pkgver.tar.gz

	cd "$srcdir/vimpager-$pkgver"

	sed -i "s/\r$//" vimpager
}

package() {
	cd "${srcdir}/vimpager-$pkgver"

	make SYSCONFDIR="/etc" PREFIX="/usr" DESTDIR="$pkgdir" install

	install -Dm644 "$srcdir/license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
}
